ci: add AI agent prompt to backport conflict comments#7367
ci: add AI agent prompt to backport conflict comments#7367christian-byrne merged 4 commits intomainfrom
Conversation
📝 WalkthroughWalkthroughAdded BACKPORT_AGENT_PROMPT_TEMPLATE and envsubst-driven computation of CONFLICTS_INLINE, SAFE_TARGET, BACKPORT_BRANCH, PR_URL, and AGENT_PROMPT; replaced the prior single-line backport-failure comment with a multi-section COMMENT_BODY template (failure reason, conflicts block, embedded AI prompt, and author note), and ensured envsubst is available. Changes
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
🎨 Storybook Build Status✅ Build completed successfully! ⏰ Completed at: 12/15/2025, 06:53:11 PM UTC 🔗 Links🎉 Your Storybook is ready for review! |
🎭 Playwright Test Results⏰ Completed at: 12/15/2025, 07:45:32 PM UTC 📈 Summary
📊 Test Reports by Browser
🎉 Click on the links above to view detailed test results for each browser configuration. |
Bundle Size ReportSummary
Category Glance Per-category breakdownApp Entry Points — 3.25 MB (baseline 3.25 MB) • ⚪ 0 BMain entry bundles and manifests
Graph Workspace — 989 kB (baseline 989 kB) • ⚪ 0 BGraph editor runtime, canvas, workflow orchestration
Views & Navigation — 6.54 kB (baseline 6.54 kB) • ⚪ 0 BTop-level views, pages, and routed surfaces
Panels & Settings — 298 kB (baseline 298 kB) • ⚪ 0 BConfiguration panels, inspectors, and settings screens
UI Components — 184 kB (baseline 184 kB) • ⚪ 0 BReusable component library chunks
Data & Services — 12.5 kB (baseline 12.5 kB) • ⚪ 0 BStores, services, APIs, and repositories
Utilities & Hooks — 3.18 kB (baseline 3.18 kB) • ⚪ 0 BHelpers, composables, and utility bundles
Vendor & Third-Party — 8.56 MB (baseline 8.56 MB) • ⚪ 0 BExternal libraries and shared vendor chunks
Other — 3.82 MB (baseline 3.82 MB) • ⚪ 0 BBundles that do not match a named category
|
When backports fail due to conflicts, the comment now includes a copyable prompt for AI coding assistants (Claude Code, Cursor, etc.) to resolve conflicts automatically. Fixes #n/a 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
363f60f to
9845f5a
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
.github/workflows/pr-backport.yaml (1)
289-295: Trim trailing delimiter fromCONFLICTSto avoid empty “- ” entries.
CONFLICTS=$(... | tr '\n' ',')commonly produces a trailing comma, which later becomes an empty line inCONFLICTS_LIST(and extra whitespace inCONFLICTS_INLINE).Minimal fix: strip trailing commas once at capture-time (best) or before rendering.
- CONFLICTS=$(git diff --name-only --diff-filter=U | tr '\n' ',') + CONFLICTS=$( + git diff --name-only --diff-filter=U \ + | paste -sd, - \ + | sed 's/,$//' + )If you prefer not to touch the earlier block, you can also
sed 's/,\+$//'right afterconflictsis read.Also applies to: 393-399
♻️ Duplicate comments (1)
.github/workflows/pr-backport.yaml (1)
360-370: Make the “AI agent prompt” template easier to maintain (and match prior feedback).This is much better than inline concatenation, but it’s still fairly wrapped/hard to edit due to manual line breaks. Consider switching to a single coherent template (no mid-sentence wraps) and/or a heredoc-style block (as discussed in prior review).
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/pr-backport.yaml(2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: deploy-and-comment
- GitHub Check: lint-and-format
- GitHub Check: test
- GitHub Check: setup
- GitHub Check: collect
Install gettext-base if envsubst is not available on the runner. While envsubst is typically present on ubuntu-latest, this adds a safety net for the critical conflict-comment step.
Use heredoc for cleaner multiline string construction. Wrap conflicting files in fenced code block instead of markdown list to handle special characters in filenames safely.
## Summary - When backports fail due to merge conflicts, the comment now includes a copyable prompt for AI coding assistants - Styled similar to CodeRabbit's "Prompt for AI Agents" feature - Prompt includes all necessary context: PR URL, merge commit, target branch, conflict files, resolution guidelines ## Example Output When a backport fails due to conflicts, the workflow now posts a cleaner comment with an AI agent prompt: --- ###⚠️ Backport to `core/1.33` failed **Reason:** Merge conflicts detected during cherry-pick of `5233749` <details> <summary>📄 Conflicting files</summary> - src/scripts/app.ts </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Backport PR Comfy-Org#7166 (Comfy-Org#7166) to core/1.33. Cherry-pick merge commit 5233749 onto new branch backport-7166-to-core-1.33 from origin/core/1.33. Resolve conflicts in: src/scripts/app.ts. For test snapshots (browser_tests/**/*-snapshots/), accept PR version if changed in original PR, else keep target. For package.json versions, keep target branch. For pnpm-lock.yaml, regenerate with pnpm install. Ask user for non-obvious conflicts. Create PR titled "[backport core/1.33] <original title>" with label "backport". See .github/workflows/pr-backport.yaml for workflow details. ``` </details> --- The "Prompt for AI Agents" section can be copied directly into Claude Code, Cursor, or other AI coding assistants to resolve the conflicts automatically. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7367-ci-add-AI-agent-prompt-to-backport-conflict-comments-2c66d73d365081e1a8fbcfdc48ea8777) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
## Summary - When backports fail due to merge conflicts, the comment now includes a copyable prompt for AI coding assistants - Styled similar to CodeRabbit's "Prompt for AI Agents" feature - Prompt includes all necessary context: PR URL, merge commit, target branch, conflict files, resolution guidelines ## Example Output When a backport fails due to conflicts, the workflow now posts a cleaner comment with an AI agent prompt: --- ###⚠️ Backport to `core/1.33` failed **Reason:** Merge conflicts detected during cherry-pick of `5233749` <details> <summary>📄 Conflicting files</summary> - src/scripts/app.ts </details> <details> <summary>🤖 Prompt for AI Agents</summary> ``` Backport PR #7166 (#7166) to core/1.33. Cherry-pick merge commit 5233749 onto new branch backport-7166-to-core-1.33 from origin/core/1.33. Resolve conflicts in: src/scripts/app.ts. For test snapshots (browser_tests/**/*-snapshots/), accept PR version if changed in original PR, else keep target. For package.json versions, keep target branch. For pnpm-lock.yaml, regenerate with pnpm install. Ask user for non-obvious conflicts. Create PR titled "[backport core/1.33] <original title>" with label "backport". See .github/workflows/pr-backport.yaml for workflow details. ``` </details> --- The "Prompt for AI Agents" section can be copied directly into Claude Code, Cursor, or other AI coding assistants to resolve the conflicts automatically. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-7367-ci-add-AI-agent-prompt-to-backport-conflict-comments-2c66d73d365081e1a8fbcfdc48ea8777) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Summary
Example Output
When a backport fails due to conflicts, the workflow now posts a cleaner comment with an AI agent prompt:
core/1.33failedReason: Merge conflicts detected during cherry-pick of
5233749📄 Conflicting files
🤖 Prompt for AI Agents
The "Prompt for AI Agents" section can be copied directly into Claude Code, Cursor, or other AI coding assistants to resolve the conflicts automatically.
┆Issue is synchronized with this Notion page by Unito